package com.hanoi.wiki.model.json;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.hanoi.wiki.model.Blocks;
import com.hanoi.wiki.model.Coordinates;

public class BlocksJson extends BaseJsonObject implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int id;
	private float longtitue;
	private float latitue;
	private float range;
	private String description;
	private List<Integer> coordinates;
	
	public BlocksJson(){
		this.coordinates = new ArrayList<Integer>();
	}
	public BlocksJson(Blocks blocks) {
		this();
		if(blocks != null) {
			this.id = blocks.getId();
			this.longtitue = blocks.getLongtitue();
			this.latitue = blocks.getLatitue();
			this.range = blocks.getRange();
			this.description = blocks.getDescription();
			for (Coordinates coordinates : blocks.getCoordinates()) {
				if(coordinates != null) {
					this.coordinates.add(coordinates.getId());
				}
			}
		}
	} 
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public float getLongtitue() {
		return longtitue;
	}
	public void setLongtitue(float longtitue) {
		this.longtitue = longtitue;
	}
	public float getLatitue() {
		return latitue;
	}
	public void setLatitue(float latitue) {
		this.latitue = latitue;
	}
	public float getRange() {
		return range;
	}
	public void setRange(float range) {
		this.range = range;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public List<Integer> getCoordinates() {
		return coordinates;
	}
	public void setCoordinates(List<Integer> coordinates) {
		this.coordinates = coordinates;
	}
	
	
}
